
#!/bin/bash
set -x
set -e

PREFIX="/opt/openldap"
EPREFIX="${PREFIX}"
# echo "${PREFIX}"

./configure \
        --program-prefix= \
        --disable-dependency-tracking \
        --prefix="${PREFIX}" \
        --exec-prefix="${EPREFIX}" \
        --bindir="${EPREFIX}/bin" \
        --sbindir="${EPREFIX}/sbin" \
        --libexecdir="${EPREFIX}/libexec" \
        --sysconfdir="${PREFIX}/etc" \
        --sharedstatedir="${PREFIX}/com" \
        --localstatedir="${PREFIX}/var" \
        --libdir="${EPREFIX}/lib" \
        --includedir="${PREFIX}/include" \
        --datarootdir="${PREFIX}/share" \
        --datadir="${PREFIX}/share" \
        --infodir="${PREFIX}/share/info" \
        --mandir="${PREFIX}/share/man" \
        --docdir="${PREFIX}/share/doc" \
        --htmldir="${PREFIX}/share/doc" \
        --dvidir="${PREFIX}/share/doc" \
        --pdfdir="${PREFIX}/share/doc" \
        --psdir="${PREFIX}/share/doc" \
        CPPFLAGS=-I/usr/local/berkeleydb/include    \
        LDFLAGS=-L/usr/local/berkeleydb/lib         \
        LD_LIBRARY_PATH=/usr/local/berkeleydb/lib   \
        --enable-debug \
        --enable-dynamic \
        --enable-syslog \
        --enable-proctitle \
        --enable-ipv6 \
        --enable-local \
        --enable-slapd \
        --enable-dynacl \
        --enable-cleartext \
        --enable-crypt \
        --enable-lmpasswd \
        --enable-spasswd \
        --enable-modules \
        --enable-rewrite \
        --enable-rlookups \
        --enable-slapi \
        --disable-slp \
        --enable-backends \
        --enable-overlays \
        --disable-static \
        --with-subdir=openldap \
        --with-cyrus-sasl \
        --without-fetch \
        --with-threads \
        --with-gssapi \
        --with-tls \
        --with-gnu-ld \
        --with-pic 

make depend 

# make 
bear make 

pushd libraries/liblmdb
make
popd